package com.ruoyi.system.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.common.utils.SecurityUtils;
import com.ruoyi.common.utils.uuid.UUID;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.ArStructMapper;
import com.ruoyi.system.domain.ArStruct;
import com.ruoyi.system.service.IArStructService;

/**
 * 结构信息Service业务层处理
 * 
 * @author ruoyi_ln
 * @date 2022-03-01
 */
@Service
public class ArStructServiceImpl implements IArStructService 
{
    @Autowired
    private ArStructMapper arStructMapper;

    /**
     * 查询结构信息
     * 
     * @param recNo 结构信息ID
     * @return 结构信息
     */
    @Override
    public ArStruct selectArStructById(String recNo)
    {
        return arStructMapper.selectArStructById(recNo);
    }

    /**
     * 查询结构信息列表
     * 
     * @param arStruct 结构信息
     * @return 结构信息
     */
    @Override
    public List<ArStruct> selectArStructList(ArStruct arStruct)
    {
        return arStructMapper.selectArStructList(arStruct);
    }

    /**
     * 新增结构信息
     * 
     * @param arStruct 结构信息
     * @return 结果
     */
    @Override
    public int insertArStruct(ArStruct arStruct)
    {
        arStruct.setRecNo(UUID.randomUUIDPlus());
        arStruct.setCreateTime(DateUtils.getNowDate());
        arStruct.setCreateBy(SecurityUtils.getUsername());
        arStruct.setDelFlag("0");
        return arStructMapper.insertArStruct(arStruct);
    }

    /**
     * 修改结构信息
     * 
     * @param arStruct 结构信息
     * @return 结果
     */
    @Override
    public int updateArStruct(ArStruct arStruct)
    {
        arStruct.setUpdateTime(DateUtils.getNowDate());
        arStruct.setUpdateBy(SecurityUtils.getUsername());
        return arStructMapper.updateArStruct(arStruct);
    }

    /**
     * 批量删除结构信息
     * 
     * @param recNos 需要删除的结构信息ID
     * @return 结果
     */
    @Override
    public int deleteArStructByIds(String[] recNos)
    {
        return arStructMapper.deleteArStructByIds(recNos);
    }

    /**
     * 删除结构信息信息
     * 
     * @param recNo 结构信息ID
     * @return 结果
     */
    @Override
    public int deleteArStructById(String recNo)
    {
        return arStructMapper.deleteArStructById(recNo);
    }
}
